<?php
/**
 * Created by PhpStorm.
 * User: C。
 * Date: 2019/8/13
 * Time: 9:04
 */
namespace app\home\controller;

use app\common\model\Report as ReportModel;

/**
 * 举报控制器
 * Class Report
 * @package app\home\controller
 */
class Report extends Base
{
    /**
     * [postAdd  举报]
     * @param
     * @return json
     * @author [C。]
     */
    public function postAdd()
    {
        $param = input('param.');
        $model = new ReportModel();
        try{
            $mem = $this->user;
            $param['addtime'] = date('Y-m-d H:i:s',time());
            $param['memid'] = $mem['id'];
            $model->addData($param);
        }catch (\Exception $e) {
            systembug($e->getMessage(),2,$this->url);
            return admin_json(-1,'举报失败'.$e->getMessage());
        }
        return admin_json(1,'举报成功');
    }
}